stage.set_background("subway")
sprite = codesters.Sprite("person10")
sprite.move_down(75)
sprite.flip_up_down()
sprite.move_right(200)
sprite.move_left(150)
sprite.flip_up_down()
stage.wait(2)
sprite.move_up(50)
sprite.turn_left(360)
sprite.move_down(50)
stage.wait(2)
sprite.flip_right_left()
stage.wait(1)
sprite.flip_right_left()
stage.wait(1)
sprite.flip_right_left()
stage.wait(1)
sprite.flip_right_left()
stage.wait(1)
try:
tval1 = sprite.get_say_text()
except:
tval1 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == "I am a sprite.", "Great Job!")
t1.add_failure(tval1 == "DNE", "Did you delete the sprite?")
t1.add_failure(tval1 == None, "Did you give your sprite a say command?")
t1.add_creative(tval1 != "I am a sprite." and tval1 != "DNE" and tval1 != None, "Creative choice!")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
Submit Work
-
Next Activity
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)